package com.kuangqiyuan;

import com.kuangqiyuan.yatzygame.Play;
import com.kuangqiyuan.yatzygame.RuleManager;
import com.kuangqiyuan.yatzygame.exception.PlayRecordException;

public class YatzyGame {
  private RuleManager ruleManager;

  public YatzyGame() {
    ruleManager = new RuleManager();
  }

  public int play(int[] input) {
    try {
      Play play = new Play(input);
      return ruleManager.countScore(play);
    } catch (PlayRecordException e) {
      return 0;
    }
  }
}
